function [PosDomain,NegDomain] = checkPositiveDomain(f,center,normal)
c = -normal(1)*center(1) - normal(2)*center(2);
nn = f.countModes();
nodes = f.getNodes();
PosDomain = [];
NegDomain = [];
for i=1:nn
    p = nodes(i).getPosition();
    if normal(1)*p(1) + normal(2)*p(2) + c > 0
        PosDomain = [PosDomain i];
    else
        NegDomain = [NegDomain i];
    end
end

%% reverse if need (PosDomain must be on the direction of normal)
p = nodes(PosDomain(1)).getPosition();
v = p-center;
if v'*normal < 0
    tmp = PosDomain;
    PosDomain = NegDomain;
    NegDomain = tmp;
end

end
